/*
 * @Description: 系统错误路由
 * @Author: xinqiao lxq1990.0716@qq.com
 * @Date: 2024-05-06
 * @LastEditors: xinqiao lxq1990.0716@qq.com
 * @LastEditTime: 2024-05-07
 */
import type { RouteRecordRaw } from 'vue-router'

import { RouterNameEnum } from '/@/enums/routerEnum'
import Layout from '/@/layouts/layout.vue'

export const notFound: RouteRecordRaw = {
  path: '/:pathMatch(.*)*',
  name: 'NotFound',
  redirect: '/error/404',
  meta: { title: 'NotFound' },
  children: [],
}

export const errorRoute: RouteRecordRaw = {
  path: '/error',
  name: 'error',
  redirect: '/error/404',
  component: Layout,
  children: [
    {
      path: '404',
      name: RouterNameEnum.NOT_FOUND,
      component: () => import('/@/views/sys/error/404.vue'),
    },
    {
      path: '500',
      name: RouterNameEnum.SYSTEM_ERROR,
      component: () => import('/@/views/sys/error/500.vue'),
    },
  ],
}
